using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._DataManagementTools._GeodatabaseAdministration
{
    /// <summary>
    /// <para>Repair Version Tables</para>
    /// <para>Repairs inconsistencies in the delta (A and D) tables of datasets that are registered for traditional versioning.</para>
    /// <para>修复为传统版本控制注册的数据集的增量（A 和 D）表中的不一致。</para>
    /// </summary>    
    [DisplayName("Repair Version Tables")]
    public class RepairVersionTables : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public RepairVersionTables()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_input_database">
        /// <para>Input Database Connection</para>
        /// <para>The database connection (.sde file) to the enterprise geodatabase in which delta table inconsistencies exist. The connection must be made as the geodatabase administrator.</para>
        /// <para>与存在增量表不一致的企业级地理数据库的数据库连接（.sde 文件）。必须以地理数据库管理员身份建立连接。</para>
        /// </param>
        /// <param name="_out_log">
        /// <para>Repair Version Tables Log</para>
        /// <para>The location where the log file will be written and the name of the log file. The log file is an ASCII file containing the results of the repair operation.</para>
        /// <para>日志文件的写入位置和日志文件的名称。日志文件是包含修复操作结果的 ASCII 文件。</para>
        /// </param>
        public RepairVersionTables(object _input_database, object _out_log)
        {
            this._input_database = _input_database;
            this._out_log = _out_log;
        }
        public override string ToolboxName => "Data Management Tools";

        public override string ToolName => "Repair Version Tables";

        public override string CallName => "management.RepairVersionTables";

        public override List<string> AcceptEnvironments => ["workspace"];

        public override object[] ParameterInfo => [_input_database, _out_log, _target_version, _input_tables, _out_workspace];

        /// <summary>
        /// <para>Input Database Connection</para>
        /// <para>The database connection (.sde file) to the enterprise geodatabase in which delta table inconsistencies exist. The connection must be made as the geodatabase administrator.</para>
        /// <para>与存在增量表不一致的企业级地理数据库的数据库连接（.sde 文件）。必须以地理数据库管理员身份建立连接。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Database Connection")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _input_database { get; set; }


        /// <summary>
        /// <para>Repair Version Tables Log</para>
        /// <para>The location where the log file will be written and the name of the log file. The log file is an ASCII file containing the results of the repair operation.</para>
        /// <para>日志文件的写入位置和日志文件的名称。日志文件是包含修复操作结果的 ASCII 文件。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Repair Version Tables Log")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _out_log { get; set; }


        /// <summary>
        /// <para>Target Version</para>
        /// <para>The geodatabase version to be repaired. The drop-down list is populated with the existing versions in the geodatabase specified for the Input Database Connection parameter. If no version is selected, all versions are processed.</para>
        /// <para>要修复的地理数据库版本。下拉列表将填充为为输入数据库连接参数指定的地理数据库中的现有版本。如果未选择任何版本，则处理所有版本。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Target Version")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _target_version { get; set; } = null;


        /// <summary>
        /// <para>Input Tables</para>
        /// <para>A single table or a text file containing a list of versioned tables with the associated delta tables to be repaired. Use fully-qualified table names in the text file, and place one table name per line. If no table or file is specified, all tables are processed.</para>
        /// <para>单个表或文本文件，其中包含要修复的关联增量表的版本化表列表。在文本文件中使用完全限定的表名，并为每行放置一个表名。如果未指定表或文件，则处理所有表。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Tables")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public List<object> _input_tables { get; set; } = null;


        /// <summary>
        /// <para>Repaired Geodatabase</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Repaired Geodatabase")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public object _out_workspace { get; set; }


        public RepairVersionTables SetEnv(object workspace = null)
        {
            base.SetEnv(workspace: workspace);
            return this;
        }

    }

}